🎖️GitЯра🎖️
.github/agents/speckit.git.commit.agent.md claude/firmware-alpha-constraints-8b2ac7 (79558585) Text, 1.86 KB
---
Tc9d1d9description: Auto-commit changes after a Spec Kit command completes
Tc9d1d9---
<!-- Extension: git -->
<!-- Config: .specify/extensions/git/ -->
Tc9d1d9# Auto-Commit Changes
Automatically stage and commit all changes after a Spec Kit command completes.
Tc9d1d9## Behavior
This command is invoked as a hook after (or before) core commands. It:
Tff7b721. Determines the event name from the hook context (e.g., if invoked as an Ta5d6ff`after_specify` hook, the event is Ta5d6ff`after_specify`; if Ta5d6ff`before_plan`, the event is Ta5d6ff`before_plan`)
Tff7b722. Checks Ta5d6ff`.specify/extensions/git/git-config.yml` for the Ta5d6ff`auto_commit` section
Tff7b723. Looks up the specific event key to see if auto-commit is enabled
Tff7b724. Falls back to Ta5d6ff`auto_commit.default` if no event-specific key exists
Tff7b725. Uses the per-command Ta5d6ff`message` if configured, otherwise a default message
Tff7b726. If enabled and there are uncommitted changes, runs Ta5d6ff`git add .` + Ta5d6ff`git commit`
Tc9d1d9## Execution
Determine the event name from the hook that triggered this command, then run the script:
Tff7b72- **Bash**: Ta5d6ff`.specify/extensions/git/scripts/bash/auto-commit.sh <event_name>`
Tff7b72- **PowerShell**: Ta5d6ff`.specify/extensions/git/scripts/powershell/auto-commit.ps1 <event_name>`
Replace Ta5d6ff`<event_name>` with the actual hook event (e.g., Ta5d6ff`after_specify`, Ta5d6ff`before_plan`, Ta5d6ff`after_implement`).
Tc9d1d9## Configuration
In Ta5d6ff`.specify/extensions/git/git-config.yml`:
Ta5d6ff```Ta5d6ffyaml
Tff7b72auto_commitTb4b4b4:
Tff7b72defaultTb4b4b4: Ta5d6fffalse T8b949e# Global toggle — set true to enable for all commands
Tff7b72after_specifyTb4b4b4:
Tff7b72enabledTb4b4b4: Ta5d6fftrue T8b949e# Override per-command
Tff7b72messageTb4b4b4: Ta5d6ff"Ta5d6ff[SpecTe6edf3 Ta5d6ffKit]Te6edf3 Ta5d6ffAddTe6edf3 Ta5d6ffspecificationTa5d6ff"
Tff7b72after_planTb4b4b4:
Tff7b72enabledTb4b4b4: Ta5d6fffalse
Tff7b72messageTb4b4b4: Ta5d6ff"Ta5d6ff[SpecTe6edf3 Ta5d6ffKit]Te6edf3 Ta5d6ffAddTe6edf3 Ta5d6ffimplementationTe6edf3 Ta5d6ffplanTa5d6ff"
Ta5d6ff```
Tc9d1d9## Graceful Degradation
Tff7b72- If Git is not available or the current directory is not a repository: skips with a warning
Tff7b72- If no config file exists: skips (disabled by default)
Tff7b72- If no changes to commit: skips with a message
Served by rngit 1.5.2 - Generated in 0.07s